class UserProfile < ActiveRecord::Base
  attr_accessible :birth_of_day, :address, :firstname, :lastname, :mssv,:user_id,:email, :password, :avatar
   attr_accessor :email, :password
  # validates :firstname, :lastname, :mssv, :email, :presence => true
  #validates :firstname,:format => { :with => /\A(\w)*\z/,:message => "Only letter, digit or underscore" }
  
  belongs_to :user
  
  has_attached_file :avatar,  :styles => {
     :thumb => "100x100#",
     :small  => "150x150>",
     :medium => "200x200" },
     
    :default_url => '/uploads/users/missing.jpg',
    :url => "/uploads/users/:id/:style/:basename.:extension",
    :path => "public/uploads/users/:id/:style/:basename.:extension"
end
